package com.anyou.mall.fin.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;

import com.anyou.mall.index.param.OrderNumParam;
import com.anyou.mall.index.param.ShopParam;
import com.anyou.mall.index.param.ShopParam2;
import com.anyou.mall.index.vo.Card4Vo;
import com.anyou.mall.index.vo.Card6Vo;
import com.anyou.mall.index.vo.OrderNumTjVo;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.anyou.common.annotation.Log;
import com.anyou.common.core.controller.BaseController;
import com.anyou.common.core.domain.ApiResult;
import com.anyou.common.enums.BusinessType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.anyou.mall.fin.domain.FinancialData;
import com.anyou.mall.fin.service.IFinancialDataService;
import com.anyou.common.utils.poi.ExcelUtil;
import com.anyou.common.core.page.TableDataInfo;

/**
 * 财务数据Controller
 *
 * @author gaochaohao
 * @date 2022-04-19
 */
@Api(tags = "财务数据")
@RestController
@RequestMapping("/fin/FinancialData")
public class FinancialDataController extends BaseController
{
    @Autowired
    private IFinancialDataService financialDataService;

    /**
     * 4个卡片的数量
     */
    @ApiOperation("4个卡片的数量")
    @PreAuthorize("@ss.hasPermi('fin:FinancialData:card4')")
    @PostMapping("/card4")
    public ApiResult<Card4Vo> card4(@Valid ShopParam2 param) {
        return financialDataService.card4(param);
    }
    /**
     * 每日提现金额统计折线图
     */
    @ApiOperation("每日提现金额统计折线图")
    @PreAuthorize("@ss.hasPermi('fin:FinancialData:tixTj')")
    @PostMapping("/tixTj")
    public ApiResult<List<OrderNumTjVo>> tixTj(@Valid OrderNumParam param) {
        return financialDataService.tixTj(param);
    }

    /**
     * 每日用户退款金额统计折线图
     */
    @ApiOperation("每日用户退款金额统计折线图")
    @PreAuthorize("@ss.hasPermi('fin:FinancialData:tugTj')")
    @PostMapping("/tugTj")
    public ApiResult<List<OrderNumTjVo>> tugTj(@Valid OrderNumParam param) {
        return financialDataService.tugTj(param);
    }
}
